import { add } from "lodash";
import request from "../../utils/request";

export function getList() {
    return request({
        url: 'user/address/List',
        method: 'get',
    })
}
export function updateAddress(address) {
    return request({
        url: 'user/address/updateAddress',
        method: 'put',
        data: address
    })
}
export function batchDeleteAddress(ids) {
    return request({
        url: 'user/address/batchDeleteAddress?ids=' + ids,
        method: 'delete',
    })
}
export function DeleteAddress(addressId) {
    return request({
        url: 'user/address/DeleteAddress',
        method: 'delete',
        params: {
            addressId: addressId
        }
    })
}

export function AddAddress(address) {
    return request({
        url: 'user/address/AddAddress',
        method: 'post',
        data: address
    })
}

export function SetDefault(currentId, oldId) {
    return request({
        url: 'user/address/setDefault',
        method: 'post',
        params: {
            currentId: currentId,
            oldId: oldId
        }
    })
}